// 导入主题
@import "../styles/themes.scss";

.layoff-calculator-page {
  padding: 16px;
  background-color: var(--bg-color);
  min-height: 100vh;
  font-size: 24px;
  transition: background-color 0.3s ease, color 0.3s ease;

  .header {
    padding: 20px 0;
    text-align: center;

    .title {
      font-size: 32px;
      font-weight: bold;
      color: var(--primary-color);
    }
  }

  // 给Cell添加主题样式
  .taroify-cell {
    color: var(--text-primary-color) !important;
    background-color: var(--card-bg-color) !important;

    &::after {
      border-bottom-color: var(--border-color) !important;
    }
  }

  .taroify-cell-group--inset {
    margin: 0 0 10px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background-color: var(--card-bg-color) !important;
    box-shadow: var(--card-shadow) !important;
  }

  // 修改单选按钮颜色
  .taroify-radio__icon--checked {
    color: var(--primary-color) !important;
  }

  // 修改嵌套的图标颜色 - 使用平铺选择器替代嵌套选择器
  .taroify-radio__icon--checked .taroify-icon {
    color: var(--primary-color) !important;
  }

  .input-section {
    margin-bottom: 20px;

    .service-time-container {
      display: flex;
      gap: 10px;
    }

    .custom-field {
      background-color: var(--card-bg-color);
      border-radius: 12px;
      padding: 15px;
      margin-bottom: 10px;
      box-shadow: var(--card-shadow);

      .field-title {
        color: var(--text-primary-color);
        margin-bottom: 8px;
        display: block;
      }

      .field-input {
        color: var(--text-primary-color);
        border-bottom: 1px solid var(--border-color);
      }
    }

    .custom-formula-box {
      display: flex;
      align-items: center;
      justify-content: flex-end;
    }

    .custom-formula {
      margin-right: 10px;
      color: var(--primary-color);
      font-size: 24px;
    }
  }

  .action-buttons {
    padding: 10px 0 20px;
    display: flex;
    justify-content: center;

    .calculate-btn {
      width: 90%;
      background: var(--button-bg);
      color: white;
      font-weight: bold;
      border-radius: 24px;
      padding: 16px 0;
      font-size: 28px;
      border: none;
    }
  }

  .result-section {
    margin-top: 20px;

    .result-card {
      padding: 24px;
      border-radius: 12px;
      margin-bottom: 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      color: white;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      transition: all 0.3s ease;

      &[style*="grey"] {
        background: linear-gradient(135deg, #757575, #424242);
      }

      &[style*="blue"] {
        background: linear-gradient(135deg, #2979ff, #1565c0);
      }

      &[style*="gold"] {
        background: linear-gradient(135deg, #ffc107, #ff9800);
      }

      .result-amount {
        font-size: 36px;
        font-weight: bold;
        margin-bottom: 8px;
      }

      .result-title {
        font-size: 24px;
        margin-bottom: 20px;
      }

      .result-details {
        width: 100%;
        font-size: 24px;
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .humor-tip {
        font-size: 24px;
        font-style: italic;
        margin-bottom: 20px;
        padding: 12px;
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        text-align: center;
      }

      .share-actions {
        display: flex;
        gap: 10px;
        width: 100%;

        .share-btn, .copy-btn {
          flex: 1;
          background-color: rgba(255, 255, 255, 0.3);
          border: 1px solid rgba(255, 255, 255, 0.5);
          color: white;
          border-radius: 6px;
          padding: 12px 0;
          font-size: 24px;

          &:active {
            background-color: rgba(255, 255, 255, 0.4);
          }
        }
      }
    }

    .tips-section {
      background-color: white;
      border-radius: 12px;
      padding: 10px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

      .tip-content {
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        font-size: 24px;
        color: #666;
      }
    }
  }

  // 弹窗样式
  .formula-help {
    color: #666;
    font-size: 24px;
    margin-top: 12px;
    display: block;
    text-align: center;
  }

  // 自定义公式容器样式
  .formula-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;

    .formula-row {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      margin-bottom: 16px;
    }

    .formula-operator {
      font-size: 34px;
      font-weight: 500;
      margin: 0 10px;
      color: #333;
    }

    .formula-variable {
      font-size: 34px;
      font-weight: 500;
      margin-right: 10px;
    }

    .small-input {
      width: 120px;
    }
  }

  // 分享卡片样式
  .share-card {
    padding: 24px;
    border-radius: 12px;
    margin: 0 auto;
    width: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;

    &[style*="grey"] {
      background: linear-gradient(135deg, #757575, #424242);
    }

    &[style*="blue"] {
      background: linear-gradient(135deg, #2979ff, #1565c0);
    }

    &[style*="gold"] {
      background: linear-gradient(135deg, #ffc107, #ff9800);
    }

    .share-card-title {
      font-size: 28px;
      font-weight: bold;
      margin-bottom: 10px;
    }

    .share-card-amount {
      font-size: 32px;
      font-weight: bold;
      margin-bottom: 6px;
    }

    .share-card-subtitle {
      font-size: 24px;
      margin-bottom: 16px;
    }

    .share-card-details {
      width: 100%;
      font-size: 24px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    // 添加二维码容器样式
    .qrcode-container {
      margin-top: 24px;
      display: flex;
      flex-direction: column;
      align-items: center;

      .qrcode-image {
        width: 120px;
        height: 120px;
        background-color: #fff;
        border-radius: 8px;
        margin-bottom: 8px;
      }

      .qrcode-tip {
        font-size: 20px;
        color: rgba(255, 255, 255, 0.8);
      }
    }
  }

  // 分享预览容器
  .share-preview {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;

    .share-card {
      width: 100%;
      max-width: 90%;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
      margin-bottom: 20px;
    }
  }

  // 在Dialog中的qrcode样式调整
  .qrcode-container {
    .qrcode-image {
      width: 120px !important;
      height: 120px !important;
      background-color: #fff;
      padding: 8px;
      box-sizing: border-box;
    }
  }

  // Canvas样式
  .share-canvas {
    // 这里的样式通过内联style设置了，所以不需要再添加
    visibility: hidden;
  }

  .cell-box {
    padding: 20px 12px;
  }
}

// 调整Taroify组件的字体大小
.taroify-cell__title {
  font-size: 24px !important;
}

.taroify-cell__value {
  font-size: 24px !important;
}

.taroify-radio__label {
  font-size: 24px !important;
}

.taroify-tabs__tab {
  font-size: 24px !important;
}

.taroify-dialog__header {
  font-size: 28px !important;
}

.taroify-button {
  font-size: 28px !important;
}

.taroify-cell-group__title {
  font-size: 24px !important;
}
